package com.example.day7;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class Fragment1 extends Fragment {
    public TextView name;
    String sss;
    public Fragment1(){

    }
    @SuppressLint("ValidFragment")
    public Fragment1(String s){
        sss=s;
    }

    public void changeData(String s){
        sss=s;
    }
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_layout,container,false);
        name=view.findViewById(R.id.yaoma);
        setData(sss);
        return view;
    }
    public void setData(String s){

        name.setText(s);
    }


}
